#include "AboutScene.h"
#include "WelcomeScene.h"
#include "SoundSettings.h"

using namespace cocos2d;


CCScene* AboutScene::scene()
{
   CCScene *scene = CCScene::create();
    AboutScene *layer = AboutScene::create();
    scene->addChild(layer);
    return scene;
}

bool AboutScene::init()
{
    if ( !CCLayer::init() )
    {
        return false;
    }
    CCMenuItemImage *pCloseItem = CCMenuItemImage::create("btn_back.png","btn_back.png",this, menu_selector(AboutScene::goBack));
    CCSize size = CCDirector::sharedDirector()->getWinSize();
    pCloseItem->setPosition( ccp(size.width - 40, size.height-40) );
    CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
    pMenu->setPosition( CCPointZero );
    this->addChild(pMenu, 1);
    CCLabelTTF* pL1 = CCLabelTTF::create("Gra stworzona w ramach", "Thonburi", 34);
    CCLabelTTF* pL2 = CCLabelTTF::create("zajec na UJ", "Thonburi", 34);
    CCLabelTTF *pL3 = CCLabelTTF::create("Grzegorz Rygula & Lukasz Durlej", "Thonburi", 34);
    pL1->setPosition( ccp(size.width / 2, (size.height/2) + 20) );
    pL2->setPosition( ccp(size.width / 2, (size.height/2) - 40) );
    pL3->setPosition( ccp(size.width / 2, size.height/ 2 + 80));
    this->addChild(pL1, 1);
    this->addChild(pL2, 1);
    this->addChild(pL3, 1);
    return true;
}

void AboutScene::goBack(CCObject* sender) {
	 CCScene *pScene = Welcome::scene();
	 CCDirector::sharedDirector()->replaceScene(pScene);
}

